<template>
  <div class="detailConPanel">
  
    <div class="detailCon members_con"
      :style="detailAll.is_item_detail_blank == 1?'padding:10px;':'padding:0'">
      <div class="topHtml" v-show="detailAll.user_need_open_store_gift!=1" v-html="diyData.topHtml"></div>
      <div class="description" :class="['fulltext', !diyData.isPreview?'preview-img':'']"
            :style="(diyData.modulePadding && diyData.modulePadding >=0)?'padding-bottom:detailAll.modulePadding+px;':''" v-html="diyData.description">
      </div>
      <div class="diyHtml" v-html="diyData.diyHtml"></div>
      <div class="bottomHtml" v-show="detailAll.user_need_open_store_gift!=1"  v-html="diyData.bottomHtml"></div>
    </div>
  </div>
</template>

<script>
  // TODO diy暂时不放
  import Vue from 'vue'
  export default Vue.extend({
    name: 'index',
    props: {
      detailAll: {
        type: Object
      },
      diyData: {
        type: Object
      }
    },
    mounted() {
      // TODO 小程序渲染后台返回的html数据 使用原生js方法 v-html不会生效
        if (document.querySelector('.topHtml')) {
          document.querySelector('.topHtml').innerHTML = this.diyData.topHtml
        }
        if (document.querySelector('.description ')) {
          document.querySelector('.description ').innerHTML = this.diyData.description 
        }
        if (document.querySelector('.diyHtml ')) {
          document.querySelector('.diyHtml ').innerHTML = this.diyData.diyHtml 
        }
        if (document.querySelector('.bottomHtml')) {
          document.querySelector('.bottomHtml').innerHTML = this.diyData.bottomHtml
        }
    }
  })
</script>

<style lang="scss">

</style>
